package com.cssl.controller;


import com.cssl.domain.DtsUserAccount;
import com.cssl.domain.dto.UserAccountDto;
import com.cssl.service.DtsUserAccountService;
import com.cssl.util.InfoCode;
import com.cssl.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/usersaccount")
public class DtsUserAccountController {

    @Autowired
    private DtsUserAccountService service;

    @PostMapping("/detailApprove")
    public Result getUserAccountByid(@RequestBody UserAccountDto userAccountDto){
        DtsUserAccount userAccountByid = service.getUserAccountByid(userAccountDto.getUserId());
       if (userAccountByid!=null){
           return Result.result(InfoCode.OK, InfoCode.MESSAGE_OK, userAccountByid, System.currentTimeMillis());
       }else {
           return Result.result(InfoCode.QUERY_EMPTY, InfoCode.MESSAGE_QUERY_EMPTY, null, System.currentTimeMillis());
       }

    }
}
